Add a compose ID parser, tweak short and version rules #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a
parse_compose_id
function tocomposeinfo
. Itcan parse most compose IDs back into their component parts. As
part of this, we tweak the rules for short names and versions
a little. The
RELEASE_SHORT_RE
regex now allows upper-casecharacters, as Fedora has been using these in short names for
some time (only
create_release_id
actually validated shortnames, up until now, which is why we hadn't noticed this
inconsistency). The
RELEASE_VERSION_RE
regex now does notallow absolutely any string that doesn't start with a digit to
be used as a version; the only string version allowed is
'Rawhide' (this is the only one that exists in the wild so far
as I know). This is to make it possible to write a sane parser
at all.
We also fix
get_date_type_respin
to work with the newci
type.
We could possibly go further than this and disallow the use of
dashes in short names; if we did that, parsing compose IDs
would become much less difficult and slightly more reliable.
But it would require us to either rename or 'grandfather in'
Fedora's existing short names with dashes in them, which are
Fedora-Atomic, Fedora-Docker and Fedora-Cloud. It would be
reasonably easy to write a parser and regex which special case
those exact names but disallow any other with a dash.
Signed-off-by: Adam Williamson [email protected]